package org.p2psimulator.entity.protocol;

import org.p2psimulator.entity.Peer;
import org.p2psimulator.engine.Environment;

public abstract class ProtocolCycle {

	public Environment getEnv() {
		return env;
	}
	public void setEnv(Environment env) {
		this.env = env;
	}
	public int getCurrentTransactionId() {
		return currentTransactionId;
	}
	public void setCurrentTransactionId(int currentTransactionId) {
		this.currentTransactionId = currentTransactionId;
	}

	protected Environment env;
	protected int currentTransactionId = 0;
	
	public ProtocolCycle (Environment env, int transId){
		this.env = env;
		this.currentTransactionId = transId;
	}
	public abstract String runRequestCycle(Peer p);
	
	public abstract String runResponseCycle(Peer p);
	
	public abstract String runSecondRequestCycle(Peer p);
	
	public abstract String runSecondResponseCycle(Peer p);
}
